package com.ruoyi.web.task;


import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.system.service.BwTabTestService;
import com.ruoyi.system.service.IByJzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.List;

@Configuration
@EnableScheduling
public class ByYhqRunner {

    @Autowired
    private IByJzService jzService;


    @Autowired
    private BwTabTestService bwTabTestService;

    // 每天凌晨检索优惠券的到期情况
//    @Scheduled(cron = "10 0 0 * * ?")
    public void stopYhq(){
        jzService.stopJzYhqStatus();
    }


//    @Scheduled(fixedRate=30*1000)
    public void test(){
        List<JSONObject> list = bwTabTestService.getAll();
        for(JSONObject obj:list){
            System.out.println(obj.getString("id"));
        }
    }

}
